From 6a3904cf0ce11f1987344b62c1cb8344825a3db6 Mon Sep 17 00:00:00 2001 From: William Hua Date: Thu, 8 Jan 2015 00:23:02 -0500 Subject: [PATCH] mir: add back window hierarchy functions --- gdk/mir/gdkmirwindowimpl.c | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 12451591fa..d4a4f2db75 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -924,6 +924,49 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window, ensure_no_surface (window); } +/* TODO: Remove once we have proper transient window support. */ +GdkWindow * +_gdk_mir_window_get_visible_transient_child (GdkWindow *window, + gdouble x, + gdouble y, + gdouble *out_x, + gdouble *out_y) +{ + GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); + GdkWindow *child = NULL; + GList *i; + + x -= window->x; + y -= window->y; + + if (x < 0 || x >= window->width || y < 0 || y >= window->height) + return NULL; + + for (i = impl->transient_children; i && !child; i = i->next) + { + if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible) + child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y); + } + + if (child) + return child; + + *out_x = x; + *out_y = y; + + return window; +} + +/* TODO: Remove once we have proper transient window support. */ +void +_gdk_mir_window_transient_children_foreach (GdkWindow *window, + void (*func) (GdkWindow *, gpointer), + gpointer user_data) +{ + GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); + g_list_foreach (impl->transient_children, (GFunc) func, user_data); +} + static void gdk_mir_window_impl_get_frame_extents (GdkWindow *window, GdkRectangle *rect) -- 2.30.2